home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3182 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: fido.asd.sgi.com!news
  2. From: austern@isolde.mti.sgi.com (Matt Austern)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Date: 22 Jan 1996 18:09:04 GMT
  6. Organization: SGI
  7. Distribution: world
  8. Message-ID: <AUSTERN.96Jan22100904@isolde.mti.sgi.com>
  9. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com>
  10.     <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu>
  11.     <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu>
  12.     <30fe666e.3349285@130.15.126.54> <4dmjt8$6sv@crc-news.doc.ca>
  13.     <30ff9519.1799465@130.15.126.54> <4doe07$4u8@crc-news.doc.ca>
  14.     <30ffe557.16481026@130.15.126.54> <GK+N9LA3rQAxEwdx@dakal.demon.co.uk>
  15. Reply-To: austern@mti.sgi.com
  16. NNTP-Posting-Host: isolde.mti.sgi.com
  17. In-reply-to: Richard Linsley Hood's message of Sat, 20 Jan 1996 15:32:07 +0000
  18.  
  19. In article <GK+N9LA3rQAxEwdx@dakal.demon.co.uk> Richard Linsley Hood <richardlh@dakal.demon.co.uk> writes:
  20.  
  21. > The method and order by which comparisons are done is determined by the 
  22. > list. This is quite reasonably part of its function. It 'knows' about 
  23. > which two items should be compared to determine which is larger, 
  24. > smaller, etc., thus it is part of its function.
  25. > The comparison of two objects should be done by themselves, 'are you 
  26. > larger, smaller than this object' thus hiding from the list how this is 
  27. > done. Only an object 'knows' how it compares to another object (of the 
  28. > same type). This is quite reasonably a function of the object.
  29. > Where is the problem?
  30.  
  31. The problem is that I might want to have one list of employees
  32. arranged alphabetically by last name, one list arranged alphabetically
  33. by first name, another arranged by numerical value of the employee ID,
  34. and another arranged chronologically by date of hire.  
  35.  
  36. For a nontrivial object (like an employee record), there are too many
  37. reasonable choices for the comparison function.  An object shouldn't
  38. necessarily impose one choice on all of its clients.
  39. -- 
  40. Matt Austern
  41. SGI: MTI Compilers Group
  42. austern@isolde.mti.sgi.com
  43.